// HashSet.h
#ifndef __HASHSET_H__
#define __HASHSET_H__

#include <tr1/unordered_set>

#include "util/Pool.h"

template <typename K, typename H = std::tr1::hash<K>, typename E = std::equal_to<K> >
class HashSet : public std::tr1::unordered_set <K, H, E, pool_allocator<K> >
{
public:
    NEW_DELETE_OPERATORS_INLINE_H(HashSet,NoSuper);

    bool contains (K k) {
        typename HashSet<K,H,E>::iterator i;
        for (i=this->begin(); i != this->end(); i++) {
            if (k == *i) {
                return true;
            }
        }
        return false;
    }
};


template <typename K, typename C>
class HashMultiSet : public std::tr1::unordered_multiset <K, C, pool_allocator<K> >
{
public:
    NEW_DELETE_OPERATORS_INLINE_H(HashMultiSet,NoSuper);
};

#endif // __HASHSET_H__
